<?php
/**
 * JoiGallery - image gallery component for Joostina
 *
 * Добавление/редактирование категории
 *
 * @version 1.0 alpha 3
 * @package JoiGallery
 * @subpackage	AdminView
 * @filename edit_category_.php
 * @author JoostinaTeam
 * @copyright (C) 2008-2009 Joostina Team
 * @license see license.txt
 *
 **/
 
defined('_VALID_MOS') or die();


?>

	<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton, section) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}

			if ( form.name.value == "" ) {
				alert("<?php echo _C_JOIGALLERY_JS_CAT_NAME ?>");
			} else {
				<?php getEditorContents( 'editor1', 'description' ) ; ?>
				submitform(pressbutton);
			}
		}
		</script>

		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th class="categories"><?php echo $row->id ? 'Edit a category' : 'Add a category';?></th>
		</tr>
		</table>

		<table class="adminform">
		<tr>
			<th colspan="3"><?php echo _C_JOIGALLERY_CAT_DETAILS ?></th>
		<tr>
		<tr>
			<td width="150"><?php echo _C_JOIGALLERY_CAT_TITLE ?></td>
			<td colspan="2"><input class="text_area" type="text" name="title" value="<?php echo stripslashes( $row->title ); ?>" size="50" maxlength="50" title="A short name to appear in menus" /></td>
		</tr>
		<tr>
			<td><?php echo _C_JOIGALLERY_CAT_NAME ?></td>
			<td colspan="2"><input class="text_area" type="text" name="name" value="<?php echo stripslashes( $row->name ); ?>" size="50" maxlength="255" title="A long name to be displayed in headings" /></td>
		</tr>
	
		<tr>
			<td><?php echo _C_JOIGALLERY_CAT_PARENT ?></td>
			<td><?php echo $lists['parent_id']; ?></td>
		</tr>
		<tr>
			<td><?php echo _C_JOIGALLERY_CAT_PUB ?></td>
			<td><?php echo $lists['published']; ?></td>
		</tr>
		<tr>
			<td valign="top" colspan="2"><?php echo _C_JOIGALLERY_CAT_DESCR ?></td>
		</tr>
		<tr>
			<td colspan="3">
			<?php
  			// parameters : areaname, content, hidden field, width, height, rows, cols
  			editorArea( 'editor1',  $row->description , 'description', '100%;', '300', '60', '20' ) ; 
			?>
			</td>
		</tr>
		</table>

		<input type="hidden" name="option" value="<?php echo $option; ?>" />
		<input type="hidden" name="act" value="categories" />
		<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="hidemainmenu" value="0" />
		</form>